import request from "axios";

/**
 * 条件分页查询权限
 * @param {Integer} pageSize
 * @param {Integer} pageNum
 * @param {String} key
 * @param {Integer} delete    
 * @returns 
 */
export function requestPermissionLimit(data) {
    return request({
        url: "/permission/limit",
        method: "post",
        data
    })
}

/**
 * 新增权限
 * @param {Object} data 
 * @returns 
 */
export function requestPermissionInert(data){
    return request({
        url:"/permission/addPermission",
        method:"post",
        data
    })
}

/**
 * 通过id查询权限
 * @param {Integer} params 
 * @returns 
 */
export function requestPermissionSelectById(params){
    return request({
        url:"/permission/selectPermissionById",
        method:"get",
        params:params
    })
}

/**
 * 修改权限
 * @param {Object} data 
 * @returns 
 */
export function requestPermissionUpdate(data){
    return request({
        url:"/permission/updatePermission",
        method:"put",
        data
    })
}

/**
 * 批量删除权限，彻底删除
 * @param {Integer} params 
 * @returns 
 */
export function requestBatchDeletePermissionById(params){
    return request({
        url:"/permission/batchCompletelyDeletePermission",
        method:"delete",
        params:params
    })
}

/**
 * 批量修改权限的删除状态
 * @param {Object} params 
 * @returns 
 */
export function requestBatchUpdatePermissionIsDelete(params){
    return request({
        url: "/permission/batchDeletePermission",
        method: "delete",
        params:params
    })
}



/**
 * 批量导入权限，通过权限模板
 * @param {Object} data 
 * @returns 
 */
export function requestPermissionUploadTemplates(data){
    return request({
        url:"/permission/uploadPermissionTemplates",
        method:"post",
        data
    })
}

/**
 * 下载批量新增权限的模板
 * @returns 
 */
export function requestPermissionDownlodaTemplates(){
    return request({
        url:"/permission/downloadPermissionTemplates",
        method:"get",
        "responseType": "blob"
    })
}